package oop5;

import oop4.Dog;
import oop4.Penguin;
import oop4.Pet;

/**
 * @author oldliu
 * @since 1.0
 */
public class Zoo {
    private String name;
    public Zoo(String n){
        this.name=n;
    }
    //返回值的多态
    public Pet sell(int money){
        if(money>=500000){
            return new Tiger("翠花",99,99,"公");
        }
        if(money>=200000){
            return new Penguin();
        }
        if(money>500){
            return new Dog("二黄",99,99,"公","博美");
        }
        return  null;
    }
}
